<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('新增联系人')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-contact-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">姓名：</label>
				<div class="col-sm-8">
					<input id="name" name="name" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">所属客户：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
						<select name="customerId" class="form-control m-b" th:with="type=${@customer.list()}">
		                    <option th:each="dict : ${type}" th:text="${dict.name}" th:value="${dict.id}"></option>
		                </select>
		            </div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">联系人类型：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
	                    <select name="type" class="form-control m-b" th:with="type=${@dict.getType('crm_contact_type')}">
		                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
		                </select>
	                </div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">部门：</label>
				<div class="col-sm-8">
					<input id="dept" name="dept" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">职位：</label>
				<div class="col-sm-8">
					<input id="position" name="position" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">性别：</label>
				<div class="col-sm-8">
					<div class="input-group" style="width: 100%">
	                    <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
		                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
		                </select>
	                </div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">生日：</label>
				<div class="col-sm-8">
					<input id="birthday" name="birthday" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">手机号：</label>
				<div class="col-sm-8">
					<input id="mobile" name="mobile" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">座机：</label>
				<div class="col-sm-8">
					<input id="tel" name="tel" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">邮箱：</label>
				<div class="col-sm-8">
					<input id="email" name="email" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">微信号：</label>
				<div class="col-sm-8">
					<input id="wechat" name="wechat" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">QQ号：</label>
				<div class="col-sm-8">
					<input id="qq" name="qq" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">传真：</label>
				<div class="col-sm-8">
					<input id="fax" name="fax" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">联系地址：</label>
				<div class="col-sm-8">
					<input id="addr" name="addr" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">补充说明：</label>
				<div class="col-sm-8">
					<textarea name="remark" autocomplete="off" maxlength="500" class="form-control" rows="3"></textarea>
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "crm/contact"
		$("#form-contact-add").validate({
			rules:{
				name:{
					required:true,
				},
			},
			focusCleanup: true
		});
		
		function submitHandler() {
	        if ($.validate.form()) {
	            $.operate.save(prefix + "/add", $('#form-contact-add').serialize());
	        }
	    }
	</script>
</body>
</html>
